package com.corona.game;

import com.badlogic.gdx.graphics.Color;
import com.corona.Game;

import java.util.ArrayList;

/* compiled from: Action.java */
/* access modifiers changed from: package-private */
/* loaded from: pokewilds.jar:com/pkmngen/game/ChangePlayerColor.class */
public class ChangePlayerColor extends Action {
    int index = 0;
    ArrayList<Color> colors = new ArrayList<>();

    public ChangePlayerColor(Action nextAction) {
        super(new Object[0]);
        this.nextAction = nextAction;
        this.colors.add(new Color(0.972549f, 0.21960784f, 0.03137255f, 1.0f));
        this.colors.add(new Color(0.9411765f, 0.3137255f, 0.1882353f, 1.0f));
        this.colors.add(new Color(0.3137255f, 0.28235295f, 0.972549f, 1.0f));
        this.colors.add(Color.CYAN);
        this.colors.add(new Color(0.21960784f, 0.72156864f, 0.09411765f, 1.0f));
        this.colors.add(Color.MAGENTA);
        this.colors.add(Color.MAROON);
        this.colors.add(Color.YELLOW);
        this.colors.add(new Color(0.47058824f, 0.3137255f, 0.09411765f, 1.0f));
        this.colors.add(Color.OLIVE);
        this.colors.add(Color.TEAL);
        this.colors.add(Color.RED);
        this.colors.add(Color.PURPLE);
        this.colors.add(new Color(1.0f, 0.4509804f, 0.78431374f, 1.0f));
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (InputProcessor.leftJustPressed) {
            this.index--;
            if (this.index < 0) {
                this.index = this.colors.size() - 1;
            }
            game.player.setColor(this.colors.get(this.index));
            game.player.currSprite = game.player.standingSprites.get(game.player.dirFacing);
        } else if (InputProcessor.rightJustPressed) {
            this.index++;
            if (this.index >= this.colors.size()) {
                this.index = 0;
            }
            game.player.setColor(this.colors.get(this.index));
            game.player.currSprite = game.player.standingSprites.get(game.player.dirFacing);
        }
        if (InputProcessor.bJustPressed) {
            game.actionStack.remove(this);
            game.insertAction(this.nextAction);
        }
    }
}
